/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  /**
   * 登录
   */
  router.post('/login', controller.admin.login);
  router.post('/reg', controller.admin.registry);
  router.get('/me', controller.admin.me);

  /**
   * 用户管理
   */
  router.post('/user/add', controller.user.addUser);
  router.post('/user/del', controller.user.delUser);
  router.post('/user/update', controller.user.updateUser);
  router.get('/user/get', controller.user.getUser);

  /**
   * 标签管理
   */
  router.post('/bank/addTag', controller.bank.addTag);
  router.post('/bank/updateTag', controller.bank.updateTag);
  router.get('/bank/getTag', controller.bank.getTags);
  router.post('/bank/delTags', controller.bank.delTags);

  /**
   * 题型管理
   */
  router.post('/bank/addQuesType', controller.bank.addQuesType);
  router.post('/bank/updateQuesType', controller.bank.updateQuesType);
  router.get('/bank/getQuseType', controller.bank.getQuseType);
  router.post('/bank/delQuesType', controller.bank.delQuesType);

  /**
   * 题目管理
   */
  router.post('/bank/addQues', controller.bank.addQues);
  router.post('/bank/delQues', controller.bank.delQues);
  router.post('/bank/updateQues', controller.bank.updateQues);
  router.get('/bank/getQues', controller.bank.getQues);

  /**
   * 试卷管理
   */
  router.post('/exam/addTestPaper', controller.exam.addTestPaper);
  router.post('/exam/delTestPaper', controller.exam.delTestPaper);
  router.post('/exam/updateTestPaper', controller.exam.updateTestPaper);
  router.get('/exam/getTestPaper', controller.exam.getTestPaper);

  router.post('/exam/addTest', controller.exam.addTest);

  /**
   * 面试管理
   */
  router.post('/meeting/addMeeting', controller.meeting.addMeeting);
  router.get('/meeting/getMeetings', controller.meeting.getMeetings);
  router.post('/meeting/delMeeting', controller.meeting.delMeeting);
  router.post('/meeting/updateMeeting', controller.meeting.updateMeeting);
  router.post('/meeting/addMeetingUsers', controller.meeting.addMeetingUsers);
  router.post('/meeting/delMeetingUsers', controller.meeting.delMeetingUsers);
  router.post('/meeting/sendEmail', controller.meeting.sendEmail);
  router.post('/meeting/updateInterViewTime', controller.meeting.updateInterViewTime);

  /**
   * 前台获取面试列表
   * @param {string} day - 当前日期
   * @param {string} userId - 面试官id
   */
  router.get('/meeting/getInterView', controller.meeting.getInterView);
};
